package top.bigdata.model.entity;

import lombok.Data;

import java.util.ArrayList;

@Data
public class Zone {
    private int tid;
    private String code;
    private String name;
    private Zone mainZone = null;
    private final ArrayList<Zone> subZones = new ArrayList<>();

    public Zone(int tid, String code, String name) {
        this.tid = tid;
        this.code = code;
        this.name = name;
    }

    public Zone(int tid, String code, String name, Zone mainZone) {
        this.tid = tid;
        this.code = code;
        this.name = name;
        this.mainZone = mainZone;
    }

    public boolean isMainZone() {
        return mainZone == null;
    }
}
